<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<link rel="stylesheet" href="">
</head>
<body>
<script src='http://cdn.jsdelivr.net/vue/1.0.26/vue.js'></script>
<script src='https://cdn.jsdelivr.net/vue.router/0.7.10/vue-router.min.js'></script>
<div id="root">
<ul>
	<li v-for="n in numbers">所有的数: {{n}}</li>
</ul>
<ul>
 <li v-for="n in eventNumbers">偶数：{{ n }}</li>
 </ul> 
</div>	
<script>
	/**
	 * 有时，要显示一个数组的过滤或排序副本，
	 * 而不实际改变或重置原始数据。在这种情况下，可以创建返回过滤或排序数组的计算属性
	 */
	var vm = new Vue({
		el : '#root',
		data : {
			numbers : [1,2,3,4,5,6,7,8,9,10],
		},
		computed : {
			eventNumbers : function(){
				return this.numbers.filter(function(number){
					return number % 2 === 0;
				});
			}
		}
	});
</script>
</body>
</html>